/* 全局样式重置 */
* {
  box-sizing: border-box;
}

:root {
  font-family: 'Inter', system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--el-bg-color-page, #f5f7fa);
  color: var(--el-text-color-primary, #303133);
  font-size: 14px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#app {
  min-height: 100vh;
  width: 100%;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--el-fill-color, #f0f2f5);
}

::-webkit-scrollbar-thumb {
  background: var(--el-border-color, #dcdfe6);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--el-text-color-disabled, #c0c4cc);
}

/* 链接样式 */
a {
  color: var(--el-color-primary, #409eff);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--el-color-primary-light-3, #79bbff);
}

/* 全局过渡动画 */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* 布局相关样式 */
.layout-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--el-bg-color-page);
}

.layout-sidebar {
  width: 250px;
  background-color: var(--theme-sidebar-bg, #ffffff);
  border-right: 1px solid var(--el-border-color-light, #e4e7ed);
  transition: width 0.3s ease;
  z-index: 1001;
}

.layout-sidebar.collapsed {
  width: 64px;
}

.layout-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.layout-header {
  height: 60px;
  background-color: var(--theme-header-bg, #ffffff);
  border-bottom: 1px solid var(--theme-header-border, #e4e7ed);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
}

.layout-content {
  flex: 1;
  padding: 20px;
  background-color: var(--el-bg-color-page);
  overflow: auto;
}

/* 固定头部样式 */
body.fixed-header .layout-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 250px;
  z-index: 1000;
  transition: left 0.3s ease;
}

body.fixed-header .layout-sidebar.collapsed+.layout-main .layout-header {
  left: 64px;
}

body.fixed-header .layout-content {
  padding-top: 80px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .layout-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .layout-sidebar.mobile-open {
    transform: translateX(0);
  }

  .layout-main {
    margin-left: 0;
  }

  body.fixed-header .layout-header {
    left: 0;
  }
}

/* 页面容器样式 */
.page-container {
  background: var(--el-bg-color, #ffffff);
  border-radius: 8px;
  border: 1px solid var(--el-border-color-lighter, #ebeef5);
  padding: 20px;
  margin-bottom: 20px;
}

/* 工具类 */
.text-primary {
  color: var(--el-text-color-primary);
}

.text-regular {
  color: var(--el-text-color-regular);
}

.text-secondary {
  color: var(--el-text-color-secondary);
}

.bg-page {
  background-color: var(--el-bg-color-page);
}

.bg-card {
  background-color: var(--el-bg-color);
}

/* 卡片阴影 */
.card-shadow {
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.card-shadow-light {
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

/* 动画类 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-left-enter-active,
.slide-left-leave-active {
  transition: transform 0.3s ease;
}

.slide-left-enter-from {
  transform: translateX(-100%);
}

.slide-left-leave-to {
  transform: translateX(-100%);
}